# -*- coding: utf-8 -*-
"""
Created on Mon Nov 16 10:33:37 2020

@author: xyz

存放主界面的切换功能函数
Ui_DALTA里存放了五个初始界面
"""

#必备的包
import sys
import os
from PyQt5.QtWidgets import QWidget, QApplication, QFileDialog, QMessageBox

#他的界面
from mainwin import Ui_DALTA

#nlmixr的包
from nlmixr import *

class MainWin(QWidget, Ui_DALTA):
    #定义了主窗口的控件，和点击左侧按钮切换界面的函数
    def __init__(self):
        super().__init__()
        self.setupUi(self)
        self.fit.hide()
        self.visual.hide()
        self.check.hide()
        self.medicine.hide()
        #左侧四个按钮点击进行界面切换
        self.fitb.clicked.connect(lambda: self.indicator(1))
        self.visualb.clicked.connect(lambda: self.indicator(2))
        self.checkb.clicked.connect(lambda: self.indicator(3))
        self.medicineb.clicked.connect(lambda: self.indicator(4))
        self.homepageb.clicked.connect(lambda: self.indicator(5))
        
        
    def indicator(self,num):
        #用来指定显示哪一个界面
            self.homepage.hide()
            self.fit.hide()
            self.visual.hide()
            self.check.hide()
            self.medicine.hide()
            if num == 1:
                self.fit.show()
            if num == 2 :
                self.visual.show()
            if num ==3 :
                self.check.show()
            if num == 4:
                self.medicine.show()
            if num == 5:
                self.homepage.show()